package com.yn.xgame.util;

import com.alibaba.fastjson.JSON;
import com.google.common.collect.ImmutableMap;

import java.util.Map;

/**
 * MapUtil
 * Created by wangboo on 17/7/14.
 */
public class MapUtil {

    public int getInt(Map map, String key) {
        return (int) map.get(key);
    }

    public static void main(String[] args) {
        Map map = ImmutableMap.of("name", "benz", "sid", 12);
        byte[] bin = JSON.toJSONBytes(map);
        System.out.println("json = " + new String(bin));
    }

}
